<template>
  <div class="container">
    <div class="swiper">
      <img src="../assets/laba.png" alt="" />
      <div v-html="`${data.mcontent}`" class="content"></div>
    </div>
  </div>
</template>

<script>
import { mapMutations, mapState } from "vuex";
export default {
  computed: {
    ...mapState(["value"]),
  },
  data() {
    return {
      data: {},
      area: {},
    };
  },
  mounted() {
    this.getData();
    this.getArea();
  },
  methods: {
    ...mapMutations(["updateUname"]),
    getData() {
      this.axios.get("v1/swiper/lun").then((res) => {
        console.log("日期", res);
        this.data = res.data[0];
      });
    },
    getArea() {
      this.axios.get("v1/area?pid=31").then((res) => {
        console.log("地区", res);
        this.area = res.data;
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.date {
  display: flex;
  padding: 15px 0;
}
.date > div {
  padding: 20px;
  font-size: 1.2em;
}
.date > div:first-child {
  margin-left: 10px;
  flex-basis: 85%;
}
.date > div:last-child {
  flex-basis: 15%;
}
.swiper {
  font-size: 1.2em;
  color: #db261d;
  background-color: #f5f5f5;
  border-top: 3px solid #db261d;
  border-bottom: 3px solid #db261d;
  padding: 3px 0;
  white-space: nowrap;
}
.swiper > img {
  z-index: 1;
  width: 9vw;
  padding: 1vh;
  background-color: #f5f5f5;
  position: relative;
}
.content {
  padding: 1vh;
  position: relative;
  display: inline-block;
  animation: text-scroll 10s linear infinite;
}
@keyframes text-scroll {
  0% {
    left: 100%;
  }
  25% {
    left: 10%;
  }
  50% {
    left: -80%;
  }
  75% {
    left: -170%;
  }
  100% {
    left: -260%;
  }
}
</style>
